
public class Node // with three instance variables and two constructors

{
	String exp;
	Node next; // a reference to the next node in the list
	int leng; // length of the expression.

	public Node(String st, Node succ) {
		exp = st;
		next = succ;
		leng = exp.length();
	}

	public Node(Node given) // A copy constructor
	{
		exp = given.exp;
		next = null;
		leng = given.leng;
	}

	// public accessor methods

	public String getExp() {
		return exp;
	}

	public Node getNext() {
		return next;
	}

	public int getLeng() {
		return leng;
	}
} // End of class Node declaration 